package com.klamerek.rainbow.client.charts.geom;

/**
 * A basic circle class 
 *
 */
public class MyCircle {

	/**
	 * Center of the point.
	 */
	private MyPoint center;

	/**
	 * Radius of the circle.
	 */
	public double radius;

	/**
	 * 	
	 * @return
	 */
	public MyPoint getCenter() {
		return center;
	}

	/**
	 * 
	 * @param center
	 */
	public void setCenter(MyPoint center) {
		this.center = center;
	}

	/**
	 * 
	 * @return
	 */
	public double getRadius() {
		return radius;
	}

	/**
	 * 
	 * @param radius
	 */
	public void setRadius(double radius) {
		this.radius = radius;
	}

	/**
	 * Constructor
	 * @param center Center of the circle.
	 * @param radius Radius of the circle.
	 */
	public MyCircle(MyPoint center, double radius){
		this.center = center;
		this.radius = radius;
	}

	/**
	 * Test if the point is inside the circle.
	 * @param x
	 * @param y
	 * @return True is the parameter point is inside the circle.
	 */
	public boolean isInside (int x, int y){ 
		return this.center.isNearZone(x, y, radius);
	}

	/**
	 * Test if the point is inside the circle.
	 * @param point
	 * @return True is the parameter point is inside the circle.
	 */
	public boolean isInside(MyPoint point){
		return this.center.isNearZone(point, radius);
	}

}
